package com.sskj.market.presenter;

import com.lzy.okgo.model.Response;
import com.sskj.common.base.HttpData;
import com.sskj.common.util.ToastUtil;
import com.sskj.lib.http.JsonCallBack;
import com.sskj.market.ui.activity.AddAddressActivity;


/**
 * @author Hey
 * Create at  2019/07/26
 */
public class AddAddressPresenter extends BasePresenter<AddAddressActivity> {

    public void addAddress(String name, String phone, String province, String city, String region, String detail, String is_default,boolean flag) {
        httpService.addAddress(name, phone, province, city, region, detail, is_default)
                .tag(this)
                .execute(new JsonCallBack<HttpData>(flag?this:null) {
                    @Override
                    public void onSuccess(Response<HttpData> response) {
                        mView.addAddressSuccess();
                    }
                });
    }
}
